﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
namespace Host.WCF.ActionServer
{
    /// <summary>
    /// Summary description for TestImage
    /// </summary>
    public class TestImage : IHttpHandler
    {

        //public void ProcessRequest(HttpContext context)
        //{
        //    context.Response.ContentType = "text/plain";
        //    context.Response.Write("Hello World");
        //}
        public void ProcessRequest(HttpContext context)
        {
            string uploadDir = "C:\\";

            if (context.Request.Files.Count > 0)
            {
                HttpPostedFile file = context.Request.Files[0];
                file.SaveAs(Path.Combine(uploadDir, file.FileName));
                context.Response.Write("success");
            }
            else
            {
                context.Response.Write("fail");
            }
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}